package com.yiqi.liebang.feature.news.view.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.framework.AM;
import com.yiqi.liebang.R;
import com.yiqi.liebang.common.util.DateTool;
import com.yiqi.liebang.entity.bo.IssuesBo;

import java.util.List;

public class PendingIssuesAdapter extends BaseQuickAdapter<IssuesBo, BaseViewHolder> {
    public PendingIssuesAdapter() {
        super(R.layout.item_issues);
    }

    @Override
    protected void convert(BaseViewHolder helper, IssuesBo item) {
        helper
                .addOnClickListener(R.id.btn_refused_add)
                .addOnClickListener(R.id.btn_pass_add)
                .setVisible(R.id.view_issues, item.getStatus() == 0 ? true : false)
                .setGone(R.id.tv_issues_status, item.getStatus() == 0 ? false : true)
                .setText(R.id.tv_issues_status, item.getStatus() == 1 ? "已同意" : item.getStatus() == 2 ? "已拒绝" : "未处理")
                .setText(R.id.tv_visitor_name, item.getUserAccountFormMap().getUserName())
                .setText(R.id.tv_visitor_position, TextUtils.isEmpty(item.getUserAccountFormMap().getPosition()) ? "暂无认证职位" :item.getUserAccountFormMap().getCompany()
                        +item.getUserAccountFormMap().getPosition())
                .addOnClickListener(R.id.iv_friend_head)
                .setVisible(R.id.iv_user_position, item.getUserAccountFormMap().getIsOccupation() == 1 ? true : false)
                .setVisible(R.id.iv_user_certification, item.getUserAccountFormMap().getIsBasic() == 1 ? true : false);

        AM.image().bindToCircleObject(item.getUserAccountFormMap().getUserHead(), helper.getView(R.id.iv_friend_head));
    }
}
